﻿#pragma once

#include "MirControl.h"
#include "MirLabel.h"
#include "../Settings.h"
#include <string>
#include <vector>
#include "../../stringhelper.h"

namespace Client::MirControls
{
    class MirScrollingLabel : public MirControl
    {
    private:
        static Regex *const R;
        static Regex *const C;

        const std::vector<MirLabel*> _textLabel;
//C# TO C++ CONVERTER WARNING: C++ has no equivalent to a 'readonly' collection which allows modification of internal state:
//ORIGINAL LINE: private readonly List<MirLabel> _textButtons;
        std::vector<MirLabel*> _textButtons;

    public:
        int Index = 0;

        Font *Font = new Font(Settings::FontName, 8.0F);
        std::vector<std::string> CurrentLines = std::vector<std::string>();
        int VisibleLines = 8;

        virtual ~MirScrollingLabel()
        {
            delete Font;
        }

        MirScrollingLabel();

        void NewText(std::vector<std::string> &lines, bool resetIndex = true);

    private:
        void NewColour(const std::string &text, const std::string &colour, Point *p);
    };
}
